﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Sunimage.Spjg.Common;
using Sunimage.Spjg.DAL;
using Sunimage.Spjg.DAL.SysMgr;

namespace Sunimage.Spjg.BLL
{
    public class NoteBl
    {
        public List<Note> GetAll()
        {
            return NoteDa.GetAll();
        }

        public List<Note> GetAllOfAUser(int id)
        {
            return NoteDa.GetAll().FindAll(f => f.CreatorId == id);
        }

        public Note GetById(int id)
        {
            return NoteDa.GetAll().Find(b => b.Id == id);
        }

        public void Create(Note note)
        {
            NoteDa.Insert(note);
        }

        public void Delete(int id)
        {
            NoteDa.Delete(id);
        }

        public void Update(Note note)
        {
            NoteDa.Update(note);
        }
    }
}
